<?php

namespace Trawind\Skeleton\Generators;

use Prettus\Repository\Generators\Migrations\SchemaParser;

/**
 * Class RemoteInterfaceGenerator
 * @package Trawind\Skeleton\Generators
 */
class RemoteInterfaceGenerator extends Generator
{

    /**
     * Get stub name.
     *
     * @var string
     */
    protected $stub = 'remote/interface';



    /**
     * Get generator path config node.
     *
     * @return string
     */
    public function getPathConfigNode()
    {
        return 'interfaces';
    }

    /**
     * Get destination path for generated file.
     *
     * @return string
     */
    public function getPath()
    {
        return $this->getBasePath() . '/Remotes/' . parent::getConfigGeneratorClassPath($this->getPathConfigNode(), true) . '/' . $this->getName() . 'Repository.php';
    }

    /**
     * Get base path of destination file.
     *
     * @return string
     */
    public function getBasePath()
    {
        return config('repository.generator.basePath', app()->path());
    }

    /**
     * Get array replacements.
     *
     * @return array
     */
    public function getReplacements()
    {
        return array_merge(parent::getReplacements(), [
        ]);
    }
    
    
    public function getNamespace()
    {
        $namespace=parent::getNamespace();
        return str_replace('TrawindCloud','Trawind\\Remotes',$namespace);
    }

    /**
     * Get root namespace.
     *
     * @return string
     */
    public function getRootNamespace()
    {
        $root_namespace=parent::getRootNamespace() . parent::getConfigGeneratorClassPath($this->getPathConfigNode());
        return str_replace('TrawindCloud','Trawind\\Remotes',$root_namespace);
    }
}
